"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller } = app;
  router.get("/", controller.home.index);

  // 注册登录
  router.post("/register", controller.user.register);
  router.post("/login", controller.user.login);

  // 用户相关
  router.get("/users/student", controller.user.getStudentList);
  router.post("/users/student", controller.user.addStudent);
  router.delete("/users/student/:id", controller.user.deleteStudent);

  // 成绩相关
  router.get("/scores", controller.score.index);
  router.post("/scores", controller.score.create);
  router.put("/scores/:id", controller.score.update);
  router.delete("/scores/:id", controller.score.destroy);
};
